package android.app.gfestival.adapter;

import java.util.ArrayList;
import java.util.List;

import android.app.gfestival.soap.ArtistDescription;
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteStatement;
import android.provider.BaseColumns;
import android.util.Log;

/**
 * A database helper to create the db table with country names
 * @author Eric
 *
 */
public class DbHelper extends SQLiteOpenHelper {

	public static final String TABLE_ARTIST = "artist";
	public static final String ARTIST_NAME = "name";
	public static final String TIME = "time";

	private static final String DATABASE_NAME = "artist.db";
	private static final int DATABASE_VERSION = 3;
	public static final String ARTIST_ID = "artist_id";
	public static final String ARTIST_SHORT_DES = "short_description";

	public DbHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
//		db.execSQL("create table " + TABLE_ARTIST + " (" +
//				BaseColumns._ID + " integer primary key autoincrement,"
//				+ ARTIST_NAME + " text not null,"
//				+ TIME + " text,"
//				+ ARTIST_SHORT_DES+ " text,"
//				+ ARTIST_ID + " text,"
//				+ "unique (" + ARTIST_NAME + ") on conflict replace)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		
//		Log.i("", "---------> drop database");
//		db.execSQL("delete database " + DATABASE_NAME);
//		Log.i("", "---------> drop table");
//		db.execSQL("drop table " + TABLE_ARTIST);
//		onCreate(db);
	}
}